package com.twu.option;

import java.util.ArrayList;
import java.util.List;

import com.twu.bean.User;
import com.twu.util.OptionsUtil;

public class HomeOption implements Option
{

	private List<Option> menuOptions;

	public HomeOption(User currentUser)
	{
        menuOptions = new ArrayList<Option>();
        menuOptions.add(new DisplayBooksOption(currentUser));
        menuOptions.add(new CheckMemberShipDetailsOption(currentUser));
        menuOptions.add(new DisplayMoviesOption());
	}

	public HomeOption()
	{
        menuOptions = new ArrayList<Option>();
        menuOptions.add(new DisplayBooksOption());
        menuOptions.add(new CheckMemberShipDetailsOption());
        menuOptions.add(new DisplayMoviesOption());
	}

	@Override
	public String execute()
	{
		return String.format("Services you can choose:\n%s", OptionsUtil.formattedOutput(menuOptions));
	}

	@Override
	public String getTips()
	{
		return OptionsUtil.formattedOutput(menuOptions) + "\n" + "Input a option number to select the option";
	}

	@Override
	public Option selectOption(int optionNumber)
	{
		return menuOptions.get(optionNumber - 1);
	}
}
